package com.ybkj.daijia.server.mapper;

import com.ybkj.daijia.server.model.DriverTime;
import com.ybkj.daijia.server.model.DriverTimeYear;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface DriverTimeYearMapper {

    /**
     * 保存年份报表
     *
     * @param record
     * @return
     */
    int insertRecord(DriverTimeYear record);

    /**
     * 根据主键查询年份报表
     *
     * @param id
     * @return
     */
    DriverTimeYear selectByPrimaryKey(Long id);

    /**
     * 根据年份和公司查询年份报表
     *
     * @param year
     * @param companyId
     * @return
     */
    DriverTimeYear selectByYearAndDriver(@Param("year") Integer year,
        @Param("driverId") Long driverId);


    /**
     * 根据主键更新年份报表
     *
     * @param record
     * @return
     */
    int updateByPrimaryKey(DriverTimeYear record);

    List<DriverTimeYear> selectByParams(@Param("year") Integer year, @Param("name") String name,
        @Param("companyId") Long companyId, @Param("offset") Integer offset,
        @Param("size") Integer size);

    Long countByParams(@Param("year") Integer year, @Param("name") String name,
        @Param("companyId") Long companyId);

    List<DriverTime> listDriverTimeByDate(@Param("start") Date start, @Param("end") Date end);

    void deleteByDriver(@Param("driverId") Long driverId);
}
